@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  html {
    scroll-behavior: smooth;
    overflow-y: scroll;
  }
  
  body {
    font-family: 'Inter', system-ui, sans-serif;
    overflow-y: scroll;
  }
}

@layer components {
  .spring-gradient {
    background: var(--gradient-primary, linear-gradient(135deg, #22c55e 0%, #16a34a 100%));
  }
  
  .spring-gradient-dark {
    background: var(--gradient-primary-dark, linear-gradient(135deg, #15803d 0%, #14532d 100%));
  }
  
  .theme-gradient {
    background: var(--gradient-primary);
  }
  
  .theme-color {
    color: var(--color-primary);
  }
  
  .theme-bg {
    background-color: var(--color-primary);
  }
  
  .theme-border {
    border-color: var(--color-primary);
  }
  
  .theme-hover:hover {
    background-color: var(--color-primary-hover);
  }
  
  .bg-theme-primary\/10 {
    background-color: color-mix(in srgb, var(--color-primary) 10%, transparent);
  }
  
  .dark .bg-theme-primary\/10 {
    background-color: color-mix(in srgb, var(--color-primary) 20%, transparent);
  }
  
  .glass-effect {
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
  }
  
  .dark .glass-effect {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .markdown-content {
    color: #374151;
    font-size: 1.125rem;
    line-height: 1.75;
    max-width: none;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }
  
  @media (max-width: 768px) {
    .markdown-content {
      font-size: 1rem;
      line-height: 1.6;
    }
  }
  
  .dark .markdown-content {
    color: #d1d5db;
  }
  
  .markdown-content h1,
  .markdown-content h2,
  .markdown-content h3,
  .markdown-content h4,
  .markdown-content h5,
  .markdown-content h6 {
    color: #111827;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 1rem;
  }
  
  .dark .markdown-content h1,
  .dark .markdown-content h2,
  .dark .markdown-content h3,
  .dark .markdown-content h4,
  .dark .markdown-content h5,
  .dark .markdown-content h6 {
    color: #f9fafb;
  }
  
  .markdown-content h1 {
    font-size: 2.25rem;
    line-height: 2.5rem;
  }
  
  .markdown-content h2 {
    font-size: 1.875rem;
    line-height: 2.25rem;
  }
  
  .markdown-content h3 {
    font-size: 1.5rem;
    line-height: 2rem;
  }
  
  .markdown-content p {
    margin-bottom: 1rem;
  }
  
  .markdown-content a {
    color: var(--color-primary, #16a34a);
    text-decoration: underline;
  }
  
  .dark .markdown-content a {
    color: var(--color-primary, #4ade80);
  }
  
  .markdown-content strong {
    font-weight: 600;
    color: #111827;
  }
  
  .dark .markdown-content strong {
    color: #f9fafb;
  }
  
  .markdown-content code {
    background-color: #f7f7f7;
    color: #0033b3;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
    border: 1px solid #e1e1e1;
  }
  
  .dark .markdown-content code {
    background-color: #2b2b2b;
    color: #a9b7c6;
    border: 1px solid #3c3c3c;
  }
  
  .markdown-content pre {
    background-color: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    overflow: hidden;
    overflow-x: auto;
    margin: 1.5rem 0;
    position: relative;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Monaco', 'Consolas', monospace;
  }
  
  @media (max-width: 768px) {
    .markdown-content pre {
      margin: 1rem -1rem;
      border-radius: 0;
      border-left: none;
      border-right: none;
    }
  }
  
  .dark .markdown-content pre {
    background-color: #1e1e1e;
    border: 1px solid #333333;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  }
  
  .markdown-content pre code {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    color: inherit !important;
    font-size: 0.875rem !important;
    line-height: 1.6 !important;
    display: block !important;
    overflow-x: auto !important;
    margin-top: 40px !important;
    padding-top: 24px !important;
    padding-bottom: 24px !important;
    padding-left: 24px !important;
    padding-right: 24px !important;
  }
  
  @media (max-width: 768px) {
    .markdown-content pre code {
      padding-top: 16px !important;
      padding-bottom: 16px !important;
      padding-left: 16px !important;
      padding-right: 16px !important;
    }
  }
  
  .markdown-content pre::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(180deg, #f7f7f7 0%, #e8e8e8 100%);
    border-bottom: 1px solid #d1d1d1;
    border-radius: 12px 12px 0 0;
    z-index: 1;
  }
  
  .dark .markdown-content pre::before {
    background: linear-gradient(180deg, #3c3c3c 0%, #2a2a2a 100%);
    border-bottom: 1px solid #4a4a4a;
  }
  
  .markdown-content pre::after {
    content: '';
    position: absolute;
    top: 12px;
    left: 16px;
    width: 12px;
    height: 12px;
    background: #ff5f57;
    border-radius: 50%;
    box-shadow: 
      20px 0 0 #ffbd2e,
      40px 0 0 #28ca42;
    z-index: 2;
  }
  
  .dark .markdown-content pre::after {
    background: #ff5f56;
    box-shadow: 
      20px 0 0 #ffbd2e,
      40px 0 0 #27c93f;
  }
  
  .markdown-content blockquote {
    border-left: 4px solid var(--color-primary, #16a34a);
    padding-left: 1rem;
    margin: 1rem 0;
    font-style: italic;
    color: #4b5563;
  }
  
  .dark .markdown-content blockquote {
    color: #d1d5db;
  }
  
  .markdown-content ul,
  .markdown-content ol {
    margin: 1rem 0;
    padding-left: 2rem;
  }
  
  .markdown-content li {
    margin-bottom: 0.5rem;
  }
  
  .code-block-container {
    position: relative;
    margin: 1.5rem 0;
  }
  
  .code-header-controls {
    position: absolute;
    top: 0;
    right: 0;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding-right: 16px;
    z-index: 10;
    pointer-events: none;
  }
  
  @media (max-width: 768px) {
    .code-header-controls {
      padding-right: 12px;
      gap: 6px;
    }
  }
  
  .code-header-controls > * {
    pointer-events: auto;
  }
  
  .code-language-label {
    background: rgba(255, 255, 255, 0.95);
    color: #555;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    font-family: 'SF Pro Text', -apple-system, BlinkMacSystemFont, sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(8px);
    height: 24px;
    display: flex;
    align-items: center;
    min-width: 50px;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }
  
  @media (max-width: 768px) {
    .code-language-label {
      font-size: 9px;
      padding: 3px 6px;
      height: 20px;
      min-width: 40px;
    }
  }
  
  .dark .code-language-label {
    background: rgba(0, 0, 0, 0.8);
    color: #bbb;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  }
  
  .code-copy-button {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 10px;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'SF Pro Text', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
    height: 24px;
    min-width: 60px;
    justify-content: center;
    border: 1px solid rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(8px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  }
  
  @media (max-width: 768px) {
    .code-copy-button {
      font-size: 9px;
      padding: 3px 6px;
      height: 20px;
      min-width: 50px;
      gap: 3px;
    }
  }
  
  .code-copy-button:hover {
    background: rgba(255, 255, 255, 1);
    color: #333;
    transform: translateY(-0.5px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  }
  
  .dark .code-copy-button {
    background: rgba(0, 0, 0, 0.8);
    color: #bbb;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  }
  
  .dark .code-copy-button:hover {
    background: rgba(0, 0, 0, 0.9);
    color: #ddd;
    transform: translateY(-0.5px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  }
  
  .code-copy-button.copied {
    background: #28a745;
    color: white;
    border-color: #28a745;
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
  }
  
  .dark .code-copy-button.copied {
    background: #28a745;
    color: white;
    border-color: #28a745;
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
  }
  
  .code-copy-button svg {
    width: 11px;
    height: 11px;
    flex-shrink: 0;
  }
  
  /* 亮色主题代码块样式 */
  .hljs {
    background: #ffffff !important;
    color: #24292f !important;
    padding: 24px !important;
    border-radius: 0 0 12px 12px !important;
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Monaco', 'Consolas', monospace !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    position: relative !important;
    margin: 0 !important;
    overflow-x: auto !important;
    display: block !important;
  }
  
  @media (max-width: 768px) {
    .hljs {
      padding: 16px !important;
      font-size: 12px !important;
      border-radius: 0 !important;
    }
  }
  
  /* 暗色主题代码块样式 */
  .dark .hljs {
    background: #1e1e1e !important;
    color: #d4d4d4 !important;
  }
  
  /* 亮色主题语法高亮 - 使用更高优先级的选择器 */
  
  /* 关键字 - 红色 */
  .hljs .hljs-keyword,
  .hljs .hljs-selector-tag,
  .hljs .hljs-literal,
  .hljs .hljs-section,
  .hljs .hljs-link,
  .hljs .hljs-tag,
  .hljs .hljs-tag .hljs-name,
  .hljs .hljs-operator,
  .hljs .hljs-built_in,
  .hljs .hljs-builtin-name {
    color: #d73a49 !important;
    font-weight: 700 !important;
  }
  
  /* 字符串 - 绿色 */
  .hljs .hljs-string,
  .hljs .hljs-template-tag,
  .hljs .hljs-template-variable,
  .hljs .hljs-template-string,
  .hljs .hljs-tag .hljs-string,
  .hljs .hljs-addition,
  .hljs .hljs-char.escape_ {
    color: #22863a !important;
    font-weight: 500 !important;
  }
  
  /* 注释 - 灰色 */
  .hljs .hljs-comment,
  .hljs .hljs-quote,
  .hljs .hljs-deletion,
  .hljs .hljs-meta,
  .hljs .hljs-doctag,
  .hljs .hljs-annotation,
  .hljs .hljs-punctuation {
    color: #6a737d !important;
    font-style: italic !important;
    font-weight: 400 !important;
  }
  
  /* 数字和函数名 - 蓝色 */
  .hljs .hljs-number,
  .hljs .hljs-regexp,
  .hljs .hljs-property,
  .hljs .hljs-function .hljs-title,
  .hljs .hljs-title.function_,
  .hljs .hljs-title.function {
    color: #005cc5 !important;
    font-weight: 600 !important;
  }
  
  /* 类型和类名 - 紫色 */
  .hljs .hljs-class .hljs-title,
  .hljs .hljs-title,
  .hljs .hljs-name,
  .hljs .hljs-type,
  .hljs .hljs-attr,
  .hljs .hljs-attribute,
  .hljs .hljs-selector-class,
  .hljs .hljs-selector-id,
  .hljs .hljs-selector-pseudo,
  .hljs .hljs-selector-attr,
  .hljs .hljs-at-rule,
  .hljs .hljs-formula {
    color: #6f42c1 !important;
    font-weight: 600 !important;
  }
  
  /* 变量和参数 - 橙色 */
  .hljs .hljs-variable,
  .hljs .hljs-variable.language_,
  .hljs .hljs-params {
    color: #e36209 !important;
    font-weight: 500 !important;
  }
  
  /* 符号 - 深绿色 */
  .hljs .hljs-symbol,
  .hljs .hljs-bullet {
    color: #28a745 !important;
    font-weight: 600 !important;
  }
  
  /* 值 - 绿色 */
  .hljs .hljs-value {
    color: #22863a !important;
    font-weight: 500 !important;
  }
  
  /* 默认文本 */
  .hljs .hljs-subst,
  .hljs .hljs-emphasis {
    color: #24292f !important;
  }
  
  .hljs .hljs-strong {
    color: #24292f !important;
    font-weight: bold !important;
  }
  
  /* 内联代码 */
  .hljs .hljs-code {
    background-color: rgba(175, 184, 193, 0.2) !important;
    padding: 0.2em 0.4em !important;
    border-radius: 3px !important;
    color: #e36209 !important;
  }
  
  /* 暗色主题 - 关键字 (蓝色系) */
  .dark .hljs-keyword,
  .dark .hljs-selector-tag,
  .dark .hljs-literal,
  .dark .hljs-section,
  .dark .hljs-link,
  .dark .hljs-tag,
  .dark .hljs-selector-tag,
  .dark .hljs-built_in,
  .dark .hljs-operator {
    color: #569cd6 !important;
    font-weight: 700 !important;
  }
  
  /* 暗色主题 - 字符串 (橙色系) */
  .dark .hljs-string,
  .dark .hljs-template-tag,
  .dark .hljs-template-variable,
  .dark .hljs-template-string,
  .dark .hljs-value,
  .dark .hljs-char.escape_,
  .dark .hljs-code {
    color: #ce9178 !important;
    font-weight: 500 !important;
  }
  
  /* 暗色主题 - 注释 (绿色系) */
  .dark .hljs-comment,
  .dark .hljs-quote,
  .dark .hljs-deletion,
  .dark .hljs-meta,
  .dark .hljs-doctag {
    color: #6a9955 !important;
    font-style: italic !important;
    font-weight: 400 !important;
  }
  
  /* 暗色主题 - 数字 (浅绿色系) */
  .dark .hljs-number,
  .dark .hljs-regexp {
    color: #b5cea8 !important;
    font-weight: 600 !important;
  }
  
  /* 暗色主题 - 类型和类名 (青色系) */
  .dark .hljs-built_in,
  .dark .hljs-builtin-name,
  .dark .hljs-class .hljs-title,
  .dark .hljs-title,
  .dark .hljs-name,
  .dark .hljs-type {
    color: #4ec9b0 !important;
    font-weight: 600 !important;
  }
  
  /* 暗色主题 - 函数名 (黄色系) */
  .dark .hljs-function .hljs-title,
  .dark .hljs-title.function_,
  .dark .hljs-title.function {
    color: #dcdcaa !important;
    font-weight: 600 !important;
  }
  
  /* 暗色主题 - 属性和变量 (浅蓝色系) */
  .dark .hljs-attr,
  .dark .hljs-attribute,
  .dark .hljs-variable,
  .dark .hljs-variable.language_,
  .dark .hljs-params,
  .dark .hljs-property {
    color: #9cdcfe !important;
    font-weight: 500 !important;
  }
  
  /* 暗色主题 - 符号 (亮蓝色系) */
  .dark .hljs-symbol,
  .dark .hljs-bullet,
  .dark .hljs-addition {
    color: #4fc1ff !important;
    font-weight: 600 !important;
  }
  
  /* 暗色主题 - 选择器 (金色系) */
  .dark .hljs-selector-class,
  .dark .hljs-selector-id,
  .dark .hljs-selector-pseudo,
  .dark .hljs-selector-attr {
    color: #d7ba7d !important;
    font-weight: 600 !important;
  }
  
  /* 暗色主题 - at规则 (紫色系) */
  .dark .hljs-at-rule,
  .dark .hljs-formula {
    color: #c586c0 !important;
    font-weight: 600 !important;
    font-style: italic !important;
  }
  
  /* 暗色主题 - 注解 (灰色系) */
  .dark .hljs-annotation,
  .dark .hljs-punctuation {
    color: #808080 !important;
    font-weight: 500 !important;
  }
  
  /* 暗色主题 - 默认文本 */
  .dark .hljs-subst,
  .dark .hljs-emphasis {
    color: #d4d4d4 !important;
  }
  
  .dark .hljs-strong {
    color: #d4d4d4 !important;
    font-weight: bold !important;
  }
  
  /* 暗色主题 - 内联代码 */
  .dark .hljs-code {
    background-color: rgba(255, 255, 255, 0.1) !important;
    padding: 0.2em 0.4em !important;
    border-radius: 3px !important;
  }
}

@layer utilities {
  .text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  }
  
  .hover-lift {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .hover-lift:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  }
  
  .line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  
  .line-clamp-3 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }
  
  /* 页面进入动画 */
  @keyframes fadeInUp {
    from {
      opacity: 0;
      transform: translateY(30px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  @keyframes fadeInDown {
    from {
      opacity: 0;
      transform: translateY(-30px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  @keyframes fadeInLeft {
    from {
      opacity: 0;
      transform: translateX(-30px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }
  
  @keyframes fadeInRight {
    from {
      opacity: 0;
      transform: translateX(30px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }
  
  @keyframes scaleIn {
    from {
      opacity: 0;
      transform: scale(0.9);
    }
    to {
      opacity: 1;
      transform: scale(1);
    }
  }
  
  @keyframes slideInRight {
    from {
      transform: translateX(100%);
      opacity: 0;
    }
    to {
      transform: translateX(0);
      opacity: 1;
    }
  }
  
  @keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
      transform: translate3d(0,0,0);
    }
    40%, 43% {
      transform: translate3d(0, -8px, 0);
    }
    70% {
      transform: translate3d(0, -4px, 0);
    }
    90% {
      transform: translate3d(0, -2px, 0);
    }
  }
  
  @keyframes pulse {
    0% {
      transform: scale(1);
    }
    50% {
      transform: scale(1.05);
    }
    100% {
      transform: scale(1);
    }
  }
  
  @keyframes shimmer {
    0% {
      background-position: -200px 0;
    }
    100% {
      background-position: calc(200px + 100%) 0;
    }
  }
  
  @keyframes float {
    0%, 100% {
      transform: translateY(0px);
    }
    50% {
      transform: translateY(-10px);
    }
  }
  
  @keyframes glow {
    0%, 100% {
      box-shadow: 0 0 5px rgba(var(--color-primary-rgb, 34, 197, 94), 0.5);
    }
    50% {
      box-shadow: 0 0 20px rgba(var(--color-primary-rgb, 34, 197, 94), 0.8);
    }
  }
  
  /* 动画类 */
  .animate-fade-in-up {
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }
  
  .animate-fade-in-down {
    animation: fadeInDown 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }
  
  .animate-fade-in-left {
    animation: fadeInLeft 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }
  
  .animate-fade-in-right {
    animation: fadeInRight 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }
  
  .animate-scale-in {
    animation: scaleIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  }
  
  .animate-slide-in-right {
    animation: slideInRight 0.3s ease-out;
  }
  
  .animate-bounce {
    animation: bounce 1s infinite;
  }
  
  .animate-pulse {
    animation: pulse 2s infinite;
  }
  
  .animate-float {
    animation: float 3s ease-in-out infinite;
  }
  
  .animate-glow {
    animation: glow 2s ease-in-out infinite;
  }
  
  /* 延迟动画 */
  .animate-delay-100 {
    animation-delay: 0.1s;
  }
  
  .animate-delay-200 {
    animation-delay: 0.2s;
  }
  
  .animate-delay-300 {
    animation-delay: 0.3s;
  }
  
  .animate-delay-500 {
    animation-delay: 0.5s;
  }
  
  /* 加载动画 */
  .loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
  }
  
  .dark .loading-shimmer {
    background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
    background-size: 200px 100%;
  }
  
  /* 悬停动画增强 */
  .hover-scale {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .hover-scale:hover {
    transform: scale(1.05);
  }
  
  .hover-rotate {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .hover-rotate:hover {
    transform: rotate(5deg);
  }
  
  .hover-bounce {
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  }
  
  .hover-bounce:hover {
    transform: translateY(-5px);
    animation: bounce 0.6s ease-in-out;
  }
  
  /* 按钮动画 */
  .btn-animated {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .btn-animated::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
  }
  
  .btn-animated:hover::before {
    left: 100%;
  }
  
  .btn-animated:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  }
  
  /* 卡片动画 */
  .card-animated {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
  }
  
  .card-animated:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
  }
  
  /* 文字动画 */
  .text-gradient-animated {
    background: linear-gradient(-45deg, var(--color-primary), var(--color-primary-hover), var(--color-primary-light), var(--color-primary));
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease infinite;
  }
  
  @keyframes gradient-shift {
    0% {
      background-position: 0% 50%;
    }
    50% {
      background-position: 100% 50%;
    }
    100% {
      background-position: 0% 50%;
    }
  }
  
  /* 图标动画 */
  .icon-spin {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  
  .icon-spin:hover {
    transform: rotate(360deg);
  }
  
  .icon-bounce {
    transition: transform 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  }
  
  .icon-bounce:hover {
    transform: scale(1.2);
    animation: bounce 0.6s ease-in-out;
  }
  
  /* 页面过渡动画 */
  .page-transition-enter {
    opacity: 0;
    transform: translateY(20px);
  }
  
  .page-transition-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
  }
  
  .page-transition-exit {
    opacity: 1;
    transform: translateY(0);
  }
  
  .page-transition-exit-active {
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
  }
  
  /* 响应式动画控制 */
  @media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
  }
  
  .toc-scroll::-webkit-scrollbar {
    width: 3px;
  }
  
  .toc-scroll::-webkit-scrollbar-track {
    background: transparent;
  }
  
  .toc-scroll::-webkit-scrollbar-thumb {
    background: rgba(156, 163, 175, 0.4);
    border-radius: 2px;
  }
  
  .toc-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(156, 163, 175, 0.7);
  }
  
  .dark .toc-scroll::-webkit-scrollbar-thumb {
    background: rgba(75, 85, 99, 0.4);
  }
  
  .dark .toc-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(75, 85, 99, 0.7);
  }
  
  @media (max-width: 768px) {
    .fixed.right-4 {
      right: 8px;
    }
    
    .fixed .w-80 {
      width: calc(100vw - 32px);
      max-width: 280px;
    }
    
    /* 移动端动画优化 */
    .hover-lift:hover {
      transform: translateY(-2px) scale(1.01);
    }
    
    .card-animated:hover {
      transform: translateY(-4px) scale(1.01);
    }
  }
  
  button {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    position: relative;
  }
  
  button::-webkit-details-marker {
    display: none;
  }
  
  button[title]:hover::after,
  button[title]:hover::before,
  button[aria-label]:hover::after,
  button[aria-label]:hover::before {
    display: none !important;
    content: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
  }
  
  button[title],
  button[aria-label] {
    position: relative;
  }
  
  button[title]:hover,
  button[aria-label]:hover {
    overflow: visible;
  }
  
  *[title]:hover::after,
  *[title]:hover::before {
    display: none !important;
  }
}
